import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'

let reducer = (state, action) => {
    let NewState = JSON.parse(JSON.stringify(state))
    switch(action.type) {
        case "SET_CLASSIFY":
            NewState.classifyList = action.list
            return NewState
        default:
            return state
    }
}

let initState = {
    classifyList: []
}

let store = createStore(reducer, initState, applyMiddleware(thunk))

export default store